//- Copyright (C) 2018-2022 Chatopera Inc, <https://www.chatopera.com>
//- 
//- Licensed under the Apache License, Version 2.0 (the "License");
//- you may not use this file except in compliance with the License.
//- You may obtain a copy of the License at
//- 
//-  http://www.apache.org/licenses/LICENSE-2.0
//- 
//-  Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
.uk-layui-form
    form.layui-form(action='/apps/agent/summary/save.html', method='post')
        input(type='hidden', name='id', value=summary.id)
        .layui-collapse
            if contacts
                .layui-colla-item
                    h2.layui-colla-title 联系人信息
                    .layui-colla-content.layui-show
                        .layui-form-item
                            .layui-inline
                                label.layui-form-label#cusname 联系人名称：
                                .layui-input-inline(style='padding:9px 0;')
                                    | #{contacts.name}
                            .layui-inline.uckefu-inline
                                label.layui-form-label 电子邮件：
                                .layui-input-inline(style='padding:9px 0;')
                                    | #{contacts.email}
                        .layui-form-item
                            .layui-inline
                                label.layui-form-label 性别：
                                .layui-input-inline
                                    .layui-input-block(style='padding:9px 0;')
                                        if contacts.gender && contacts.gender == '1'
                                            | 男
                                        if contacts.gender && contacts.gender == '0'
                                            | 女
                                        if contacts.gender && contacts.gender == '-1'
                                            | 未知
                            .layui-inline.uckefu-inline
                                label.layui-form-label 生日：
                                .layui-input-inline(style='padding:9px 0;')
                                    | #{contacts.cusbirthday}
                        .layui-form-item
                            .layui-inline
                                label.layui-form-label 联系电话：
                                .layui-input-inline(style='padding:9px 0;')
                                    | #{contacts.phone}
                            .layui-inline.uckefu-inline
                                label.layui-form-label 手机号：
                                .layui-input-inline(style='padding:9px 0;')
                                    | #{contacts.mobile}
                        if contacts.address && contacts.address != ""
                            .layui-form-item
                                .layui-inline
                                    label.layui-form-label 联系人地址：
                                    .layui-input-inline(style="width: 664px;padding:9px 0;")
                                        | #{contacts.address}
            .layui-colla-item
                h2.layui-colla-title 服务小结
                .layui-colla-content.layui-show
                    .layui-form-item
                        .layui-inline
                            label.layui-form-label#cusname 姓名：
                            .layui-input-inline(style='padding:9px 0;')
                                | #{summary.username}
                        if summary.phone
                            .layui-inline.uckefu-inline
                                label.layui-form-label 电话：
                                .layui-input-inline(style='padding:9px 0;')
                                    | #{summary.phone}
                    .layui-form-item
                        .layui-inline
                            label.layui-form-label 记录时间：
                            .layui-input-inline
                                .layui-input-block(style='padding:9px 0;')
                                    | #{pugHelper.formatDate('yyyy-MM-dd HH:mm:ss', summary.createtime)}
                            if summary.email
                                .layui-inline.uckefu-inline
                                    label.layui-form-label 邮件：
                                    .layui-input-inline
                                        .layui-input-block(style="padding:9px 0;")
                                            | #{summary.email}
                    .layui-form-item
                        if summary.resion
                            .layui-inline.uckefu-inline
                                label.layui-form-label 来访原因：
                                .layui-input-inline(style="padding:9px 0;")
                                    | #{summary.resion}
                    .layui-form-item
                        .layui-inline
                            label.layui-form-label 服务类型：
                            .layui-input-inline(style='padding:9px 0;')
                                if summary.servicetype
                                    for st,index in summary.servicetype.split(",")
                                        if summaryTags
                                            for tag in summaryTags
                                                if st == tag.id
                                                    if index > 0
                                                        | ，
                                                    | #{tag.tag}
                        .layui-inline.uckefu-inline
                            label.layui-form-label 是否预约：
                            .layui-input-inline
                                .layui-input-block(style='padding:9px 0;')
                                    if summary.reservation
                                        i.layui-icon(style="color:#19a55d;") 
                    .layui-form-item
                        .layui-inline
                            label.layui-form-label 预约方式：
                            .layui-input-inline(style='padding:9px 0;')
                                | #{uKeFuDic[summary.reservtype].name}
                        .layui-inline.uckefu-inline
                            label.layui-form-label 预约时间：
                            .layui-input-inline
                                .layui-input-block(style='padding:9px 0;')
                                    | #{pugHelper.formatDate('yyyy-MM-dd HH:mm:ss', summary.reservtime)}

                    .layui-form-item
                        .layui-inline
                            label.layui-form-label 服务小结：
                            .layui-input-inline(style='padding:9px 0;width:640px;')
                                | #{summary.summary}
                    li.
            .layui-colla-item
                h2.layui-colla-title 备注
                .layui-colla-content.layui-show
                    .layui-form-item
                        .layui-inline
                            label.layui-form-label 处理备注：
                            .layui-input-inline(style='width: 664px;')
                                textarea.layui-textarea(name='processmemo', placeholder='请输入处理备注', style='resize:none;')
        .layui-form-button
            .layui-button-block
                button.layui-btn(lay-submit, lay-filter='formDemo') 标记为已处理
                button.layui-btn.layui-btn-original(type='reset') 重置
script.
    layui.use('element', function () {
        var element = layui.element();
        element.init();
    });
            
